package org.springblade.modules.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.admin.entity.MaintainMsg;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.admin.vo.MaintainMsgVO;
import org.springblade.modules.admin.vo.MsgTypeVO;

import java.util.List;

public interface MaintainMsgService extends BaseService<MaintainMsg> {

    List<MsgTypeVO> listMsgType();

    IPage<MaintainMsgVO> selectMsgPage(Integer typeId, Integer status,Integer bType, IPage<MaintainMsgVO> page);

    void sendMsg(MaintainMsg msg);

	void sendMsg(List<MaintainMsg> messages);

	/**
	 * 发送平台消息
	 *
	 * @param msg {
	 *            "title": "标题",
	 *            "content": "内容",
	 *            "type": 消息类型,
	 *            "otherId": 关联业务表id
	 *            }
	 */
	void sendMsg(MaintainMsg msg,List<Long> userIds);

	/**
	 * 发送平台消息
	 *
	 * @param msg {
	 *            "title": "标题",
	 *            "content": "内容",
	 *            "type": 消息类型,
	 *            "otherId": 关联业务表id
	 *            }
	 */
	Long sendMsg(MaintainMsg msg,List<Long> userIds,String tenantId);

	Boolean readBath(List<Long> typeIds, Long userId);

	Boolean read(Long id, Long userId);
}

